Integrand size = 21, antiderivative size = 261 \[ \int \cot ^3(c+d x) (a+b \tan (c+d x))^n \, dx=\frac {b (1-n) \cot (c+d x) (a+b \tan (c+d x))^{1+n}}{2 a^2 d}-\frac {\cot ^2(c+d x) (a+b \tan (c+d x))^{1+n}}{2 a d}-\frac {\operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \tan (c+d x)}{a-i b}\right ) (a+b \tan (c+d x))^{1+n}}{2 (a-i b) d (1+n)}-\frac {\operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \tan (c+d x)}{a+i b}\right ) (a+b \tan (c+d x))^{1+n}}{2 (a+i b) d (1+n)}+\frac {\left (2 a^2+b^2 (1-n) n\right ) \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,1+\frac {b \tan (c+d x)}{a}\right ) (a+b \tan (c+d x))^{1+n}}{2 a^3 d (1+n)} \]
1/2*b*(1-n)*cot(d*x+c)*(a+b*tan(d*x+c))^(1+n)/a^2/d-1/2*cot(d*x+c)^2*(a+b* tan(d*x+c))^(1+n)/a/d-1/2*hypergeom([1, 1+n],[2+n],(a+b*tan(d*x+c))/(a-I*b ))*(a+b*tan(d*x+c))^(1+n)/(a-I*b)/d/(1+n)-1/2*hypergeom([1, 1+n],[2+n],(a+ b*tan(d*x+c))/(a+I*b))*(a+b*tan(d*x+c))^(1+n)/(a+I*b)/d/(1+n)+1/2*(2*a^2+b ^2*(1-n)*n)*hypergeom([1, 1+n],[2+n],1+b*tan(d*x+c)/a)*(a+b*tan(d*x+c))^(1 +n)/a^3/d/(1+n)
Time = 2.08 (sec) , antiderivative size = 212, normalized size of antiderivative = 0.81 \[ \int \cot ^3(c+d x) (a+b \tan (c+d x))^n \, dx=-\frac {(b+a \cot (c+d x)) \left (a^3 (a+i b) \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \tan (c+d x)}{a-i b}\right )+(a-i b) \left (a^3 \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \tan (c+d x)}{a+i b}\right )+(a+i b) \left (a (1+n) \cot (c+d x) (b (-1+n)+a \cot (c+d x))+\left (-2 a^2+b^2 (-1+n) n\right ) \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,1+\frac {b \tan (c+d x)}{a}\right )\right )\right )\right ) \tan (c+d x) (a+b \tan (c+d x))^n}{2 a^3 (a-i b) (a+i b) d (1+n)} \]
-1/2*((b + a*Cot[c + d*x])*(a^3*(a + I*b)*Hypergeometric2F1[1, 1 + n, 2 + n, (a + b*Tan[c + d*x])/(a - I*b)] + (a - I*b)*(a^3*Hypergeometric2F1[1, 1 + n, 2 + n, (a + b*Tan[c + d*x])/(a + I*b)] + (a + I*b)*(a*(1 + n)*Cot[c + d*x]*(b*(-1 + n) + a*Cot[c + d*x]) + (-2*a^2 + b^2*(-1 + n)*n)*Hypergeom etric2F1[1, 1 + n, 2 + n, 1 + (b*Tan[c + d*x])/a])))*Tan[c + d*x]*(a + b*T an[c + d*x])^n)/(a^3*(a - I*b)*(a + I*b)*d*(1 + n))
Time = 1.34 (sec) , antiderivative size = 276, normalized size of antiderivative = 1.06, number of steps used = 17, number of rules used = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.762, Rules used = {3042, 4052, 3042, 4132, 25, 3042, 4137, 27, 3042, 4022, 3042, 4020, 25, 78, 4117, 75}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \cot ^3(c+d x) (a+b \tan (c+d x))^n \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(a+b \tan (c+d x))^n}{\tan (c+d x)^3}dx\) |
\(\Big \downarrow \) 4052 |
\(\displaystyle -\frac {\int \cot ^2(c+d x) (a+b \tan (c+d x))^n \left (b (1-n) \tan ^2(c+d x)+2 a \tan (c+d x)+b (1-n)\right )dx}{2 a}-\frac {\cot ^2(c+d x) (a+b \tan (c+d x))^{n+1}}{2 a d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {\int \frac {(a+b \tan (c+d x))^n \left (b (1-n) \tan (c+d x)^2+2 a \tan (c+d x)+b (1-n)\right )}{\tan (c+d x)^2}dx}{2 a}-\frac {\cot ^2(c+d x) (a+b \tan (c+d x))^{n+1}}{2 a d}\) |
\(\Big \downarrow \) 4132 |
\(\displaystyle -\frac {-\frac {\int -\cot (c+d x) (a+b \tan (c+d x))^n \left (2 a^2+b^2 (1-n) n \tan ^2(c+d x)+b^2 (1-n) n\right )dx}{a}-\frac {b (1-n) \cot (c+d x) (a+b \tan (c+d x))^{n+1}}{a d}}{2 a}-\frac {\cot ^2(c+d x) (a+b \tan (c+d x))^{n+1}}{2 a d}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\frac {\frac {\int \cot (c+d x) (a+b \tan (c+d x))^n \left (2 a^2+b^2 (1-n) n \tan ^2(c+d x)+b^2 (1-n) n\right )dx}{a}-\frac {b (1-n) \cot (c+d x) (a+b \tan (c+d x))^{n+1}}{a d}}{2 a}-\frac {\cot ^2(c+d x) (a+b \tan (c+d x))^{n+1}}{2 a d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {\frac {\int \frac {(a+b \tan (c+d x))^n \left (2 a^2+b^2 (1-n) n \tan (c+d x)^2+b^2 (1-n) n\right )}{\tan (c+d x)}dx}{a}-\frac {b (1-n) \cot (c+d x) (a+b \tan (c+d x))^{n+1}}{a d}}{2 a}-\frac {\cot ^2(c+d x) (a+b \tan (c+d x))^{n+1}}{2 a d}\) |
\(\Big \downarrow \) 4137 |
\(\displaystyle -\frac {\frac {\left (2 a^2+b^2 (1-n) n\right ) \int \cot (c+d x) (a+b \tan (c+d x))^n \left (\tan ^2(c+d x)+1\right )dx+\int -2 a^2 \tan (c+d x) (a+b \tan (c+d x))^ndx}{a}-\frac {b (1-n) \cot (c+d x) (a+b \tan (c+d x))^{n+1}}{a d}}{2 a}-\frac {\cot ^2(c+d x) (a+b \tan (c+d x))^{n+1}}{2 a d}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle -\frac {\frac {\left (2 a^2+b^2 (1-n) n\right ) \int \cot (c+d x) (a+b \tan (c+d x))^n \left (\tan ^2(c+d x)+1\right )dx-2 a^2 \int \tan (c+d x) (a+b \tan (c+d x))^ndx}{a}-\frac {b (1-n) \cot (c+d x) (a+b \tan (c+d x))^{n+1}}{a d}}{2 a}-\frac {\cot ^2(c+d x) (a+b \tan (c+d x))^{n+1}}{2 a d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {\frac {\left (2 a^2+b^2 (1-n) n\right ) \int \frac {(a+b \tan (c+d x))^n \left (\tan (c+d x)^2+1\right )}{\tan (c+d x)}dx-2 a^2 \int \tan (c+d x) (a+b \tan (c+d x))^ndx}{a}-\frac {b (1-n) \cot (c+d x) (a+b \tan (c+d x))^{n+1}}{a d}}{2 a}-\frac {\cot ^2(c+d x) (a+b \tan (c+d x))^{n+1}}{2 a d}\) |
\(\Big \downarrow \) 4022 |
\(\displaystyle -\frac {\cot ^2(c+d x) (a+b \tan (c+d x))^{n+1}}{2 a d}-\frac {-\frac {b (1-n) \cot (c+d x) (a+b \tan (c+d x))^{n+1}}{a d}+\frac {\left (2 a^2+b^2 (1-n) n\right ) \int \frac {(a+b \tan (c+d x))^n \left (\tan (c+d x)^2+1\right )}{\tan (c+d x)}dx-2 a^2 \left (\frac {1}{2} i \int (1-i \tan (c+d x)) (a+b \tan (c+d x))^ndx-\frac {1}{2} i \int (i \tan (c+d x)+1) (a+b \tan (c+d x))^ndx\right )}{a}}{2 a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {\cot ^2(c+d x) (a+b \tan (c+d x))^{n+1}}{2 a d}-\frac {-\frac {b (1-n) \cot (c+d x) (a+b \tan (c+d x))^{n+1}}{a d}+\frac {\left (2 a^2+b^2 (1-n) n\right ) \int \frac {(a+b \tan (c+d x))^n \left (\tan (c+d x)^2+1\right )}{\tan (c+d x)}dx-2 a^2 \left (\frac {1}{2} i \int (1-i \tan (c+d x)) (a+b \tan (c+d x))^ndx-\frac {1}{2} i \int (i \tan (c+d x)+1) (a+b \tan (c+d x))^ndx\right )}{a}}{2 a}\) |
\(\Big \downarrow \) 4020 |
\(\displaystyle -\frac {\cot ^2(c+d x) (a+b \tan (c+d x))^{n+1}}{2 a d}-\frac {-\frac {b (1-n) \cot (c+d x) (a+b \tan (c+d x))^{n+1}}{a d}+\frac {\left (2 a^2+b^2 (1-n) n\right ) \int \frac {(a+b \tan (c+d x))^n \left (\tan (c+d x)^2+1\right )}{\tan (c+d x)}dx-2 a^2 \left (\frac {\int -\frac {(a+b \tan (c+d x))^n}{1-i \tan (c+d x)}d(i \tan (c+d x))}{2 d}+\frac {\int -\frac {(a+b \tan (c+d x))^n}{i \tan (c+d x)+1}d(-i \tan (c+d x))}{2 d}\right )}{a}}{2 a}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\frac {\cot ^2(c+d x) (a+b \tan (c+d x))^{n+1}}{2 a d}-\frac {-\frac {b (1-n) \cot (c+d x) (a+b \tan (c+d x))^{n+1}}{a d}+\frac {\left (2 a^2+b^2 (1-n) n\right ) \int \frac {(a+b \tan (c+d x))^n \left (\tan (c+d x)^2+1\right )}{\tan (c+d x)}dx-2 a^2 \left (-\frac {\int \frac {(a+b \tan (c+d x))^n}{1-i \tan (c+d x)}d(i \tan (c+d x))}{2 d}-\frac {\int \frac {(a+b \tan (c+d x))^n}{i \tan (c+d x)+1}d(-i \tan (c+d x))}{2 d}\right )}{a}}{2 a}\) |
\(\Big \downarrow \) 78 |
\(\displaystyle -\frac {\cot ^2(c+d x) (a+b \tan (c+d x))^{n+1}}{2 a d}-\frac {-\frac {b (1-n) \cot (c+d x) (a+b \tan (c+d x))^{n+1}}{a d}+\frac {\left (2 a^2+b^2 (1-n) n\right ) \int \frac {(a+b \tan (c+d x))^n \left (\tan (c+d x)^2+1\right )}{\tan (c+d x)}dx-2 a^2 \left (-\frac {(a+b \tan (c+d x))^{n+1} \operatorname {Hypergeometric2F1}\left (1,n+1,n+2,\frac {a+b \tan (c+d x)}{a-i b}\right )}{2 d (n+1) (a-i b)}-\frac {(a+b \tan (c+d x))^{n+1} \operatorname {Hypergeometric2F1}\left (1,n+1,n+2,\frac {a+b \tan (c+d x)}{a+i b}\right )}{2 d (n+1) (a+i b)}\right )}{a}}{2 a}\) |
\(\Big \downarrow \) 4117 |
\(\displaystyle -\frac {\cot ^2(c+d x) (a+b \tan (c+d x))^{n+1}}{2 a d}-\frac {-\frac {b (1-n) \cot (c+d x) (a+b \tan (c+d x))^{n+1}}{a d}+\frac {\frac {\left (2 a^2+b^2 (1-n) n\right ) \int \cot (c+d x) (a+b \tan (c+d x))^nd\tan (c+d x)}{d}-2 a^2 \left (-\frac {(a+b \tan (c+d x))^{n+1} \operatorname {Hypergeometric2F1}\left (1,n+1,n+2,\frac {a+b \tan (c+d x)}{a-i b}\right )}{2 d (n+1) (a-i b)}-\frac {(a+b \tan (c+d x))^{n+1} \operatorname {Hypergeometric2F1}\left (1,n+1,n+2,\frac {a+b \tan (c+d x)}{a+i b}\right )}{2 d (n+1) (a+i b)}\right )}{a}}{2 a}\) |
\(\Big \downarrow \) 75 |
\(\displaystyle -\frac {\cot ^2(c+d x) (a+b \tan (c+d x))^{n+1}}{2 a d}-\frac {-\frac {b (1-n) \cot (c+d x) (a+b \tan (c+d x))^{n+1}}{a d}+\frac {-\frac {\left (2 a^2+b^2 (1-n) n\right ) (a+b \tan (c+d x))^{n+1} \operatorname {Hypergeometric2F1}\left (1,n+1,n+2,\frac {b \tan (c+d x)}{a}+1\right )}{a d (n+1)}-2 a^2 \left (-\frac {(a+b \tan (c+d x))^{n+1} \operatorname {Hypergeometric2F1}\left (1,n+1,n+2,\frac {a+b \tan (c+d x)}{a-i b}\right )}{2 d (n+1) (a-i b)}-\frac {(a+b \tan (c+d x))^{n+1} \operatorname {Hypergeometric2F1}\left (1,n+1,n+2,\frac {a+b \tan (c+d x)}{a+i b}\right )}{2 d (n+1) (a+i b)}\right )}{a}}{2 a}\) |
-1/2*(Cot[c + d*x]^2*(a + b*Tan[c + d*x])^(1 + n))/(a*d) - (-((b*(1 - n)*C ot[c + d*x]*(a + b*Tan[c + d*x])^(1 + n))/(a*d)) + (-(((2*a^2 + b^2*(1 - n )*n)*Hypergeometric2F1[1, 1 + n, 2 + n, 1 + (b*Tan[c + d*x])/a]*(a + b*Tan [c + d*x])^(1 + n))/(a*d*(1 + n))) - 2*a^2*(-1/2*(Hypergeometric2F1[1, 1 + n, 2 + n, (a + b*Tan[c + d*x])/(a - I*b)]*(a + b*Tan[c + d*x])^(1 + n))/( (a - I*b)*d*(1 + n)) - (Hypergeometric2F1[1, 1 + n, 2 + n, (a + b*Tan[c + d*x])/(a + I*b)]*(a + b*Tan[c + d*x])^(1 + n))/(2*(a + I*b)*d*(1 + n))))/a )/(2*a)
3.8.14.3.1 Defintions of rubi rules used
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((c + d*x )^(n + 1)/(d*(n + 1)*(-d/(b*c))^m))*Hypergeometric2F1[-m, n + 1, n + 2, 1 + d*(x/c)], x] /; FreeQ[{b, c, d, m, n}, x] && !IntegerQ[n] && (IntegerQ[m] || GtQ[-d/(b*c), 0])
Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(b *c - a*d)^n*((a + b*x)^(m + 1)/(b^(n + 1)*(m + 1)))*Hypergeometric2F1[-n, m + 1, m + 2, (-d)*((a + b*x)/(b*c - a*d))], x] /; FreeQ[{a, b, c, d, m}, x] && !IntegerQ[m] && IntegerQ[n]
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[c*(d/f) Subst[Int[(a + (b/d)*x)^m/(d^2 + c*x), x], x, d*Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[ b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && EqQ[c^2 + d^2, 0]
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(c + I*d)/2 Int[(a + b*Tan[e + f*x])^m*( 1 - I*Tan[e + f*x]), x], x] + Simp[(c - I*d)/2 Int[(a + b*Tan[e + f*x])^m *(1 + I*Tan[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && !IntegerQ[m]
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b^2*(a + b*Tan[e + f*x])^(m + 1)*((c + d*Tan[e + f*x])^(n + 1)/(f*(m + 1)*(a^2 + b^2)*(b*c - a*d))), x] + Simp[1 /((m + 1)*(a^2 + b^2)*(b*c - a*d)) Int[(a + b*Tan[e + f*x])^(m + 1)*(c + d*Tan[e + f*x])^n*Simp[a*(b*c - a*d)*(m + 1) - b^2*d*(m + n + 2) - b*(b*c - a*d)*(m + 1)*Tan[e + f*x] - b^2*d*(m + n + 2)*Tan[e + f*x]^2, x], x], x] / ; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && IntegerQ[2*m] && LtQ[m, -1] && (LtQ[n, 0] || Integ erQ[m]) && !(ILtQ[n, -1] && ( !IntegerQ[m] || (EqQ[c, 0] && NeQ[a, 0])))
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.)*((A_) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[A/f Subst[Int[(a + b*x)^m*(c + d*x)^n, x], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, C, m, n}, x] && EqQ[A, C]
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(A*b^2 - a*(b*B - a*C))*(a + b*Tan[e + f*x])^(m + 1)*((c + d*Tan[e + f*x])^(n + 1)/(f*(m + 1)*(b*c - a*d)*(a^2 + b^2))), x] + Simp[1/((m + 1)*(b*c - a*d)*(a^2 + b^2)) Int[(a + b*Tan[e + f*x])^(m + 1)*(c + d*Tan[e + f*x])^n*Simp[A*(a*(b*c - a*d)*(m + 1) - b^2*d* (m + n + 2)) + (b*B - a*C)*(b*c*(m + 1) + a*d*(n + 1)) - (m + 1)*(b*c - a*d )*(A*b - a*B - b*C)*Tan[e + f*x] - d*(A*b^2 - a*(b*B - a*C))*(m + n + 2)*Ta n[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C, n}, x] && NeQ [b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && LtQ[m, -1] && !(ILtQ[n, -1] && ( !IntegerQ[m] || (EqQ[c, 0] && NeQ[a, 0])))
Int[(((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_)*((A_.) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2))/((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Sim p[1/(a^2 + b^2) Int[(c + d*Tan[e + f*x])^n*Simp[a*(A - C) - (A*b - b*C)*T an[e + f*x], x], x], x] + Simp[(A*b^2 + a^2*C)/(a^2 + b^2) Int[(c + d*Tan [e + f*x])^n*((1 + Tan[e + f*x]^2)/(a + b*Tan[e + f*x])), x], x] /; FreeQ[{ a, b, c, d, e, f, A, C, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && !GtQ[n, 0] && !LeQ[n, -1]
\[\int \left (\cot ^{3}\left (d x +c \right )\right ) \left (a +b \tan \left (d x +c \right )\right )^{n}d x\]
\[ \int \cot ^3(c+d x) (a+b \tan (c+d x))^n \, dx=\int { {\left (b \tan \left (d x + c\right ) + a\right )}^{n} \cot \left (d x + c\right )^{3} \,d x } \]
\[ \int \cot ^3(c+d x) (a+b \tan (c+d x))^n \, dx=\int \left (a + b \tan {\left (c + d x \right )}\right )^{n} \cot ^{3}{\left (c + d x \right )}\, dx \]
\[ \int \cot ^3(c+d x) (a+b \tan (c+d x))^n \, dx=\int { {\left (b \tan \left (d x + c\right ) + a\right )}^{n} \cot \left (d x + c\right )^{3} \,d x } \]
\[ \int \cot ^3(c+d x) (a+b \tan (c+d x))^n \, dx=\int { {\left (b \tan \left (d x + c\right ) + a\right )}^{n} \cot \left (d x + c\right )^{3} \,d x } \]
Timed out. \[ \int \cot ^3(c+d x) (a+b \tan (c+d x))^n \, dx=\int {\mathrm {cot}\left (c+d\,x\right )}^3\,{\left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )}^n \,d x \]